//
//  DZMGlobalProperty.swift
//  DZMeBookRead
//
//  Created by 邓泽淼 on 2017/5/11.
//  Copyright © 2017年 DZM. All rights reserved.
//

import UIKit

// MARK: -- 屏幕属性

extension UIScreen {
    /// 屏幕宽度
    var width:CGFloat {
        return self.bounds.width
    }
    /// 屏幕高度
    var height:CGFloat {return self.bounds.height}
}

// MARK: -- 颜色支持
extension UIColor {
    
    private convenience init(r:CGFloat,g:CGFloat,b:CGFloat,a:CGFloat = 1.0) {
        self.init(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: a)
    }
    
    struct cj {
        /// 红色
        static let red = UIColor(r: 230.0, g: 86.0, b: 81.0)
        
        /// 灰色
        static let color_1 = UIColor(r: 51, g: 51, b: 51)
        
        /// 主题色绿色
        static let color_2 = UIColor(r: 66, g: 193, b: 144)
        
        /// 阅读上下状态栏颜色
        static let color_3 = UIColor(r: 127, g: 136, b: 138)
        
        /// 小说阅读上下状态栏字体颜色
        static let color_4 = UIColor(r: 127, g: 136, b: 138)
        
        /// LeftView文字颜色
        static let color_6 = UIColor(r: 170, g: 170, b: 170)
        
        static let color_7 = UIColor(r: 100, g: 100, b: 100)
    }
    
    /// 阅读背景颜色支持
    struct readBg {
        static let eye = UIColor(r: 199, g: 217, b: 189)
        static let day = UIColor(r: 227, g: 212, b: 179)
        static let byRefresh = UIColor(r: 227, g: 227, b: 227)
        static let yellow = UIColor(r: 218, g: 202, b: 174)
        static let night = UIColor(r: 0, g: 0, b: 0)
    }
    
    /// 小说阅读文字颜色
    struct readText {
        static let eye = UIColor(r: 30, g: 43, b: 22)
        static let day = UIColor(r: 84, g: 58, b: 31)
        static let byRefresh = UIColor(r: 0, g: 0, b: 2)
        static let yellow = UIColor(r: 89, g: 64, b: 52)
        static let night = UIColor(r: 42, g: 62, b: 71)
    }
    
    /// 小说阅读Header and footer颜色
    struct readHeaderAndFooterText {
        static let eye = UIColor(r: 144, g: 164, b: 132)
        static let day = UIColor(r: 153, g: 129, b: 106)
        static let byRefresh = UIColor(r: 131, g: 136, b: 142)
        static let yellow = UIColor(r: 135, g: 108, b: 94)
        static let night = UIColor(r: 43, g: 49,b: 61)
    }
    
    struct readMenu {
        /// 菜单背景颜色
        static let bg = UIColor(r: 46, g: 46, b: 46, a: 1)
        // 菜单文字颜色
        static let text = UIColor(r: 170, g: 170, b: 170)
        // 菜单文字按下去颜色
        static let textPress = UIColor(r: 130, g: 130, b: 130)
    }
}

// MARK: -- 字体支持
extension UIFont {
    struct system {
        static let _10 = UIFont.systemFont(ofSize: 10)
        static let _12 = UIFont.systemFont(ofSize: 12)
        static let _14 = UIFont.systemFont(ofSize: 14)
        static let _18 = UIFont.systemFont(ofSize: 18)

    }
}

// MARK: -- 间距支持
extension CGFloat {
    
    /// 导航栏高度
    static let navgationBarHeight:CGFloat = 64
    
    /// TabBar高度
    static let tabBarHeight:CGFloat = 49
    
    /// StatusBar高度
    static let statusBarHeight:CGFloat = 20
    
    /// 间距
    struct readerSpace {
        static let _1:CGFloat = 15
        static let _2:CGFloat = 25
        static let _3:CGFloat = 1
        static let _4:CGFloat = 10
        static let _5:CGFloat = 20
        static let _6:CGFloat = 5
    }
    
}
